
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>扩展 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="5.8.html" />
    
    
    <link rel="prev" href="5.6.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" >
            
                <a target="_blank" href="https://github.com/xfl03/CoreModTutor">
            
                    
                    源代码仓库（求star）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="./">
            
                <a href="./">
            
                    
                    目录
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="0.html">
            
                <a href="0.html">
            
                    
                    0 绪论
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" >
            
                <span>
            
                    
                    1 简介
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="1.1.html">
            
                <a href="1.1.html">
            
                    
                    CoreMod
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="1.2.html">
            
                <a href="1.2.html">
            
                    
                    Java虚拟机
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="1.3.html">
            
                <a href="1.3.html">
            
                    
                    Minecraft混淆方式
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" >
            
                <span>
            
                    
                    2 Java虚拟机
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" >
            
                <span>
            
                    
                    ClassLoader类加载器
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" >
            
                <span>
            
                    
                    ByteCode字节码
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" >
            
                <span>
            
                    
                    ASM
            
                </span>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" >
            
                <span>
            
                    
                    3 原版 CoreMod
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="3.1.html">
            
                <a href="3.1.html">
            
                    
                    直接修改class文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="3.2.html">
            
                <a href="3.2.html">
            
                    
                    JavaAgent
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="3.3.html">
            
                <a href="3.3.html">
            
                    
                    LaunchWrapper
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="3.4.html">
            
                <a href="3.4.html">
            
                    
                    ModLauncher
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" >
            
                <span>
            
                    
                    4 FML CoreMod
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="4.1.html">
            
                <a href="4.1.html">
            
                    
                    1.3.2-1.5.2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="4.2.html">
            
                <a href="4.2.html">
            
                    
                    1.6.1-1.12.2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="4.3.html">
            
                <a href="4.3.html">
            
                    
                    1.13.2-1.14.4
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="5.html">
            
                <a href="5.html">
            
                    
                    5 Mixin
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="5.1.html">
            
                <a href="5.1.html">
            
                    
                    配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="5.2.html">
            
                <a href="5.2.html">
            
                    
                    引导
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="5.3.html">
            
                <a href="5.3.html">
            
                    
                    注入
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.4" data-path="5.4.html">
            
                <a href="5.4.html">
            
                    
                    修改
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.5" data-path="5.5.html">
            
                <a href="5.5.html">
            
                    
                    定位
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.6" data-path="5.6.html">
            
                <a href="5.6.html">
            
                    
                    融合
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.8.7" data-path="5.7.html">
            
                <a href="5.7.html">
            
                    
                    扩展
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.8" data-path="5.8.html">
            
                <a href="5.8.html">
            
                    
                    调试
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" >
            
                <span>
            
                    
                    附录
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="附录A.html">
            
                <a href="附录A.html">
            
                    
                    附录A 相关工具下载
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="附录B.html">
            
                <a href="附录B.html">
            
                    
                    附录B 常见Java字节码指令表
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.3" data-path="附录C.html">
            
                <a href="附录C.html">
            
                    
                    附录C 参考资料
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >扩展</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x6269;&#x5C55;">&#x6269;&#x5C55;</h1>
<p>Mixin&#x63D0;&#x4F9B;&#x4E86;&#x51E0;&#x4E2A;&#x63A5;&#x53E3;&#x4F9B;&#x6A21;&#x7EC4;&#x4F7F;&#x7528;&#xFF0C;&#x8FD9;&#x4E9B;&#x63A5;&#x53E3;&#x5168;&#x90E8;&#x4F4D;&#x4E8E;<code>org.spongepowered.asm.mixin.extensibility</code>&#x5305;&#x4E0B;</p>
<h2 id="imixinconfigplugin"><a href="http://jenkins.liteloader.com/job/Mixin/javadoc/org/spongepowered/asm/mixin/extensibility/IMixinConfigPlugin.html" target="_blank"><code>IMixinConfigPlugin</code></a></h2>
<p>&#x8FD9;&#x4E2A;&#x63A5;&#x53E3;&#x53EF;&#x4EE5;&#x5E94;&#x7528;&#x4E8E;&#x8FD0;&#x884C;&#x65F6;&#x52A8;&#x6001;&#x4FEE;&#x6539;Mixin&#x914D;&#x7F6E;&#xFF0C;&#x4EE5;&#x53CA;&#x6709;&#x9650;&#x5730;&#x63A7;&#x5236;Mixin&#x8FD0;&#x4F5C;&#x3002;<br>&#x9700;&#x8981;&#x5728;json&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x7684;<code>plugin</code>&#x5C5E;&#x6027;&#x4E2D;&#x6307;&#x5B9A;&#x5B9E;&#x73B0;&#x7C7B;&#x7684;&#x5168;&#x540D;&#x624D;&#x80FD;&#x751F;&#x6548;&#x3002;<br>&#x5B9E;&#x73B0;&#x8FD9;&#x4E2A;&#x63A5;&#x53E3;&#x7684;&#x7C7B;&#x4E0D;&#x80FD;&#x8C03;&#x7528;Minecraft&#x4E2D;&#x7684;&#x4EFB;&#x4F55;&#x4EE3;&#x7801;&#x548C;&#x5176;&#x4ED6;&#x672C;&#x4E0D;&#x5E94;&#x8BE5;&#x5728;CoreMod&#x9636;&#x6BB5;&#x8C03;&#x7528;&#x7684;&#x4EE3;&#x7801;&#x3002;</p>
<p>&#x8FD9;&#x4E2A;&#x63A5;&#x53E3;&#x63D0;&#x4F9B;&#x4E86;&#x4EE5;&#x4E0B;&#x65B9;&#x6CD5;&#xFF1A;</p>
<ul>
<li><code>onLoad</code>: &#x5728;&#x63D2;&#x4EF6;&#x6240;&#x5728;&#x7684;&#x914D;&#x7F6E;&#x52A0;&#x8F7D;&#x5B8C;&#x6210;&#x540E;&#x8C03;&#x7528;&#xFF0C;&#x53EF;&#x4EE5;&#x5728;&#x8FD9;&#x91CC;&#x505A;&#x4E00;&#x4E9B;&#x57FA;&#x672C;&#x7684;&#x6A21;&#x7EC4;&#x521D;&#x59CB;&#x5316;&#x8BBE;&#x7F6E;&#x3002;</li>
<li><code>getRefMapperConfig</code>: &#x53EA;&#x6709;&#x5F53;&#x63D2;&#x4EF6;&#x6240;&#x5728;&#x7684;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E2D;&#x6CA1;&#x6709;&#x6307;&#x5B9A;<code>refmap</code>&#x5C5E;&#x6027;&#x65F6;&#xFF0C;&#x8FD9;&#x4E2A;&#x65B9;&#x6CD5;&#x624D;&#x4F1A;&#x88AB;&#x8C03;&#x7528;&#xFF0C;&#x5141;&#x8BB8;&#x8FD0;&#x884C;&#x65F6;&#x52A8;&#x6001;&#x6307;&#x5B9A;refmap&#x6587;&#x4EF6;&#xFF1B;<ul>
<li>&#x9700;&#x8981;&#x8FD4;&#x56DE;refmap.json&#x6587;&#x4EF6;&#x7684;&#x6587;&#x4EF6;&#x540D;&#xFF0C;&#x5982;&#x679C;&#x8FD4;&#x56DE;<code>null</code>&#xFF0C;&#x5219;&#x4F1A;&#x7528;&#x9ED8;&#x8BA4;&#x7684;refmap&#x3002;</li>
</ul>
</li>
<li><code>shouldApplyMixin</code>: &#x5728;Mixin&#x6CE8;&#x5165;&#x7C7B;&#x5373;&#x5C06;&#x5408;&#x5E76;&#x5230;&#x76EE;&#x6807;&#x7C7B;&#x524D;&#x8C03;&#x7528;&#xFF0C;&#x4F20;&#x5165;&#x4E24;&#x4E2A;&#x53C2;&#x6570;&#xFF1A;<ul>
<li><code>targetClassName</code>: &#x76EE;&#x6807;&#x7C7B;&#x5168;&#x540D;&#xFF1B;</li>
<li><code>mixinClassName</code>: &#x6CE8;&#x5165;&#x7C7B;&#x5168;&#x540D;&#xFF1B;</li>
<li>&#x9700;&#x8981;&#x8FD4;&#x56DE;&#x4E00;&#x4E2A;&#x5E03;&#x5C14;&#x503C;&#xFF0C;&#x7528;&#x4E8E;&#x6307;&#x793A;&#x662F;&#x5426;&#x6267;&#x884C;&#x5408;&#x5E76;&#x3002;</li>
</ul>
</li>
<li><code>acceptTargets</code>: &#x5728;&#x6240;&#x6709;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x8F7D;&#x5165;&#x5B8C;&#x6210;&#x540E;&#x8C03;&#x7528;&#xFF0C;&#x4F20;&#x5165;&#x4E24;&#x4E2A;<code>Set</code>&#xFF0C;&#x5141;&#x8BB8;&#x6A21;&#x7EC4;&#x79FB;&#x9664;&#x8FD9;&#x4E24;&#x4E2A;<code>Set</code>&#x4E2D;&#x7684;&#x5185;&#x5BB9;&#xFF0C;&#x4F46;&#x662F;&#x5F80;&#x8FD9;&#x4E24;&#x4E2A;<code>Set</code>&#x4E2D;&#x6DFB;&#x52A0;&#x4EFB;&#x4F55;&#x5185;&#x5BB9;&#x90FD;&#x662F;&#x65E0;&#x6548;&#x7684;&#xFF1A;<ul>
<li><code>myTargets</code>: &#x63D2;&#x4EF6;&#x6240;&#x5728;&#x7684;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E2D;&#x7684;&#x6240;&#x6709;&#x76EE;&#x6807;&#x7C7B;&#x5168;&#x540D;&#xFF1B;</li>
<li><code>otherTargets</code>: &#x5176;&#x4ED6;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E2D;&#x7684;&#x6240;&#x6709;&#x76EE;&#x6807;&#x7C7B;&#x5168;&#x540D;&#x3002;</li>
</ul>
</li>
<li><code>getMixins</code>: &#x8FD9;&#x4E2A;&#x65B9;&#x6CD5;&#x5141;&#x8BB8;&#x6A21;&#x7EC4;&#x52A8;&#x6001;&#x6DFB;&#x52A0;&#x6CE8;&#x5165;&#x7C7B;&#xFF1A;<ul>
<li>&#x9700;&#x8981;&#x8FD4;&#x56DE;&#x4E00;&#x4E2A;<code>List</code>&#xFF0C;&#x5176;&#x4E2D;&#x5B58;&#x653E;&#x8981;&#x6DFB;&#x52A0;&#x7684;&#x6CE8;&#x5165;&#x7C7B;&#x7684;&#x5168;&#x540D;&#xFF0C;&#x5982;&#x679C;&#x8FD4;&#x56DE;<code>null</code>&#xFF0C;&#x5219;&#x8868;&#x793A;&#x4E0D;&#x6DFB;&#x52A0;&#x4EFB;&#x4F55;&#x5185;&#x5BB9;&#x3002;</li>
</ul>
</li>
<li><code>preApply</code>: &#x5728;&#x6CE8;&#x5165;&#x7C7B;&#x5E94;&#x7528;&#x5230;&#x76EE;&#x6807;&#x7C7B;&#x4E4B;&#x524D;&#x8C03;&#x7528;&#xFF0C;&#x4F20;&#x5165;&#x56DB;&#x4E2A;&#x53C2;&#x6570;&#xFF1A;<ul>
<li><code>targetClassName</code>: &#x76EE;&#x6807;&#x7C7B;&#x5168;&#x540D;&#xFF1B;</li>
<li><code>targetClass</code>: &#x76EE;&#x6807;&#x7C7B;&#x5408;&#x5E76;&#x524D;&#x7684;<code>ClassNode</code>&#xFF08;&#x6CE8;&#x610F;&#x7C7B;&#x5168;&#x540D;&#x662F;<code>org.spongepowered.asm.lib.tree.ClassNode</code>&#xFF0C;&#x800C;&#x4E0D;&#x662F;<code>org.objectweb.asm.tree.ClassNode</code>&#xFF0C;Mixin&#x4E2D;&#x5305;&#x542B;&#x4E86;&#x4E00;&#x4E2A;&#x8FD1;&#x4E4E;&#x5B8C;&#x6574;&#x7684;ASM&#x5E93;&#xFF09;&#xFF1B;</li>
<li><code>mixinClassName</code>: &#x6CE8;&#x5165;&#x7C7B;&#x5168;&#x540D;&#xFF1B;</li>
<li><code>mixinInfo</code>: &#x4F20;&#x5165;&#x4E00;&#x4E2A;<code>IMixinInfo</code>&#x7C7B;&#x578B;&#x7684;&#x5BF9;&#x8C61;&#xFF0C;&#x76EE;&#x524D;&#x53EA;&#x6709;&#x4E00;&#x4E2A;&#x7C7B;&#x5B9E;&#x73B0;&#x4E86;&#x8FD9;&#x4E2A;&#x63A5;&#x53E3;&#xFF1A;<code>org.spongepowered.asm.mixin.transformer.MixinInfo</code>&#xFF08;&#x8FD9;&#x4E2A;&#x7C7B;&#x6CA1;&#x6709;Javadoc&#xFF09;&#x3002;</li>
</ul>
</li>
<li><code>postApply</code>: &#x5728;&#x6CE8;&#x5165;&#x7C7B;&#x5E94;&#x7528;&#x5230;&#x76EE;&#x6807;&#x7C7B;&#x4E4B;&#x540E;&#x8C03;&#x7528;&#xFF0C;&#x4F20;&#x5165;&#x56DB;&#x4E2A;&#x53C2;&#x6570;&#xFF1A;<ul>
<li><code>targetClassName</code>: &#x540C;&#x4E0A;&#xFF1B;</li>
<li><code>targetClass</code>: &#x76EE;&#x6807;&#x7C7B;&#x5408;&#x5E76;&#x540E;&#x7684;<code>ClassNode</code>&#xFF1B;</li>
<li><code>mixinClassName</code>: &#x540C;&#x4E0A;&#xFF1B;</li>
<li><code>mixinInfo</code>: &#x540C;&#x4E0A;&#x3002;</li>
</ul>
</li>
</ul>
<h2 id="ienvironmenttokenprovider"><a href="http://jenkins.liteloader.com/job/Mixin/javadoc/org/spongepowered/asm/mixin/extensibility/IEnvironmentTokenProvider.html" target="_blank"><code>IEnvironmentTokenProvider</code></a></h2>
<p>&#x4E4B;&#x524D;&#x4ECB;&#x7ECD;&#x7684;&#x7528;&#x4E8E;&#x6CE8;&#x5165;&#x7684;&#x6CE8;&#x89E3;&#x4E2D;&#x6709;&#x4E00;&#x4E2A;&#x6CA1;&#x6709;&#x63D0;&#x5230;&#x7684;&#x5C5E;&#x6027;&#xFF1A;<code>constraints</code>&#xFF0C;&#x4E3A;&#x4E86;&#x907F;&#x514D;&#x51FA;&#x73B0;&#x517C;&#x5BB9;&#x6027;&#x7B49;&#x95EE;&#x9898;&#xFF0C;&#x8FD9;&#x4E2A;&#x5C5E;&#x6027;&#x7684;&#x503C;&#x4F1A;&#x8FDB;&#x884C;&#x9A8C;&#x8BC1;&#xFF0C;&#x53EA;&#x6709;&#x9A8C;&#x8BC1;&#x901A;&#x8FC7;&#x624D;&#x80FD;&#x6210;&#x529F;&#x6CE8;&#x5165;&#x5230;&#x76EE;&#x6807;&#x4E2D;&#x53BB;&#x3002;<br><code>constraints</code>&#x7684;&#x503C;&#x7684;&#x683C;&#x5F0F;&#x662F;<code>&lt;token&gt;(&lt;constraint&gt;)</code>&#xFF1A;</p>
<ul>
<li><code>&lt;token&gt;</code>: &#x5FC5;&#x987B;&#x662F;&#x4E00;&#x4E32;&#x5927;&#x5199;&#x7684;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;&#x800C;&#x4E14;&#x5FC5;&#x987B;&#x6709;&#x5B9E;&#x73B0;&#x8FD9;&#x4E2A;&#x63A5;&#x53E3;&#x7684;&#x7C7B;&#x5B9A;&#x4E49;&#x8FC7;&#x8FD9;&#x4E2A;&#x5B57;&#x7B26;&#x4E32;&#xFF1B;</li>
<li><code>getToken</code>: &#x63A5;&#x53E3;&#x4E2D;&#x7684;&#x8FD9;&#x4E2A;&#x65B9;&#x6CD5;&#x6B63;&#x662F;&#x5B9A;&#x4E49;&#x5904;&#x7406;&#x8FD9;&#x4E2A;<code>&lt;token&gt;</code>&#x7684;&#xFF0C;&#x65B9;&#x6CD5;&#x4F20;&#x5165;&#x4E24;&#x4E2A;&#x53C2;&#x6570;&#xFF1A;<ul>
<li><code>token</code>: &#x5728;<code>constraints</code>&#x4E2D;&#x5199;&#x7684;<code>&lt;token&gt;</code>&#x90E8;&#x5206;&#x7684;&#x5B57;&#x7B26;&#x4E32;&#xFF1B;</li>
<li><code>env</code>: &#x8868;&#x660E;&#x5F53;&#x524D;&#x7684;&#x8FD0;&#x884C;&#x73AF;&#x5883;&#xFF1B;</li>
<li>&#x8981;&#x6C42;&#x8FD4;&#x56DE;&#x4E00;&#x4E2A;<code>Integer</code>&#xFF0C;&#x8FD9;&#x4E2A;&#x503C;&#x4F1A;&#x548C;<code>&lt;constraint&gt;</code>&#x4E2D;&#x5199;&#x7684;&#x8FDB;&#x884C;&#x6BD4;&#x8F83;&#xFF0C;&#x5982;&#x679C;&#x8FD4;&#x56DE;<code>null</code>&#xFF0C;&#x5219;&#x8868;&#x793A;&#x4F20;&#x5165;&#x7684;<code>token</code>&#x672A;&#x88AB;&#x5B9A;&#x4E49;&#xFF0C;&#x5982;&#x679C;&#x6240;&#x6709;&#x7684;<code>IEnvironmentTokenProvider</code>&#x5B9E;&#x73B0;&#x7C7B;&#x90FD;&#x5BF9;&#x8FD9;&#x4E2A;<code>token</code>&#x8FD4;&#x56DE;<code>null</code>&#xFF0C;&#x90A3;&#x4E48;&#x5C31;&#x4F1A;&#x629B;&#x51FA;&#x5F02;&#x5E38;&#xFF0C;&#x6E38;&#x620F;&#x9000;&#x51FA;&#x3002;</li>
</ul>
</li>
<li><code>&lt;constraint&gt;</code>: &#x5199;&#x4E00;&#x4E2A;&#x548C;&#x6574;&#x578B;&#x6570;&#x5B57;&#x6BD4;&#x8F83;&#x7684;&#x89C4;&#x5219;&#xFF1A;<ul>
<li><code>(1234)</code>: &#x8868;&#x793A;&#x8981;&#x6C42;<code>getToken</code>&#x5FC5;&#x987B;&#x8FD4;&#x56DE;1234&#xFF1B;</li>
<li><code>(&gt;1234)</code>: &#x8868;&#x793A;&#x8981;&#x6C42;<code>getToken</code>&#x8FD4;&#x56DE;&#x503C;&#x5FC5;&#x987B;&#x5927;&#x4E8E;1234&#xFF1B;</li>
<li><code>(1234+)</code>&#x3001;<code>(1234-)</code>&#x3001;<code>(1234&gt;)</code>&#x3001;<code>(&gt;=1234)</code>: &#x90FD;&#x8868;&#x793A;&#x8981;&#x6C42;<code>getToken</code>&#x8FD4;&#x56DE;&#x503C;&#x5FC5;&#x987B;&#x5927;&#x4E8E;&#x7B49;&#x4E8E;1234&#xFF1B;</li>
<li><code>(&lt;1234)</code>: &#x8868;&#x793A;&#x8981;&#x6C42;<code>getToken</code>&#x8FD4;&#x56DE;&#x503C;&#x5FC5;&#x987B;&#x5C0F;&#x4E8E;1234&#xFF1B;</li>
<li><code>(1234&lt;)</code>&#x3001;<code>(&lt;=1234)</code>: &#x90FD;&#x8868;&#x793A;&#x8981;&#x6C42;<code>getToken</code>&#x8FD4;&#x56DE;&#x503C;&#x5FC5;&#x987B;&#x5C0F;&#x4E8E;&#x7B49;&#x4E8E;1234&#xFF1B;</li>
<li><code>(1234-1300)</code>: &#x8868;&#x793A;&#x8981;&#x6C42;<code>getToken</code>&#x8FD4;&#x56DE;&#x503C;&#x5728;[1234, 1300]&#x533A;&#x95F4;&#x5185;&#xFF1B;</li>
<li><code>(1234+10)</code>: &#x8868;&#x793A;&#x8981;&#x6C42;<code>getToken</code>&#x8FD4;&#x56DE;&#x503C;&#x5728;[1234, 1244]&#x533A;&#x95F4;&#x5185;&#xFF1B;</li>
</ul>
</li>
</ul>
<p>&#x5B9E;&#x73B0;&#x8FD9;&#x4E2A;&#x63A5;&#x53E3;&#x7684;&#x7C7B;&#x9700;&#x8981;&#x5728;&#x5F15;&#x5BFC;Mixin&#x65F6;&#x6DFB;&#x52A0;&#xFF1A;</p>
<pre><code class="lang-java"><span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">injectIntoClassLoader</span><span class="hljs-params">(LaunchClassLoader classLoader)</span> </span>{
    MixinBootstrap.init();
    Mixins.addConfiguration(<span class="hljs-string">&quot;mixins.example.json&quot;</span>);
    MixinEnvironment.getCurrentEnvironment().registerTokenProviderClass(<span class="hljs-string">&quot;com.example.ExampleTokenProvider&quot;</span>); <span class="hljs-comment">// &#x4E5F;&#x53EF;&#x4EE5;&#x4F20;&#x5165;&#x8FD9;&#x4E2A;&#x7C7B;&#x7684;&#x5B9E;&#x4F8B;&#xFF0C;&#x4E3B;&#x8981;&#x7528;&#x4E8E;&#x5F53;&#x8FD9;&#x4E2A;&#x7C7B;&#x6CA1;&#x6709;&#x65E0;&#x53C2;&#x6784;&#x9020;&#x65B9;&#x6CD5;&#x65F6;</span>
}
</code></pre>
<h2 id="imixinerrorhandler"><a href="http://jenkins.liteloader.com/job/Mixin/javadoc/org/spongepowered/asm/mixin/extensibility/IMixinErrorHandler.html" target="_blank"><code>IMixinErrorHandler</code></a></h2>
<p>&#x8FD9;&#x4E2A;&#x63A5;&#x53E3;&#x53EF;&#x4EE5;&#x7528;&#x4E8E;&#x5F53;mixin&#x8FD0;&#x884C;&#x51FA;&#x73B0;&#x5F02;&#x5E38;&#x65F6;&#x4FEE;&#x6539;&#x5F02;&#x5E38;&#x4FE1;&#x606F;&#x3002;</p>
<ul>
<li><code>onPrepareError</code>: &#x5F53;Mixin&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x521D;&#x59CB;&#x5316;&#x51FA;&#x73B0;&#x5F02;&#x5E38;&#x65F6;&#x8C03;&#x7528;&#xFF1A;<ul>
<li><code>config</code>: &#x51FA;&#x73B0;&#x5F02;&#x5E38;&#x7684;&#x914D;&#x7F6E;&#xFF1B;</li>
<li><code>th</code>: &#x5F15;&#x53D1;&#x7684;&#x5F02;&#x5E38;&#xFF0C;&#x6B64;&#x65F6;&#x5141;&#x8BB8;&#x4FEE;&#x6539;&#x5F02;&#x5E38;&#x7684;&#x5185;&#x5BB9;&#xFF1B;</li>
<li><code>mixin</code>: &#x4F20;&#x5165;&#x4E00;&#x4E2A;&#x8D1F;&#x8D23;&#x5904;&#x7406;&#x8FD9;&#x4E2A;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x7684;<code>IMixinInfo</code>&#x7C7B;&#x578B;&#x7684;&#x5BF9;&#x8C61;&#xFF1B;</li>
<li><code>action</code>: &#x4F20;&#x5165;&#x4E00;&#x4E2A;&#x9ED8;&#x8BA4;&#x7684;&#x5F02;&#x5E38;&#x7B49;&#x7EA7;&#xFF1B;</li>
<li>&#x8981;&#x6C42;&#x8FD4;&#x56DE;&#x4E00;&#x4E2A;&#x65B0;&#x7684;&#x5F02;&#x5E38;&#x7B49;&#x7EA7;&#xFF0C;&#x5982;&#x679C;&#x8FD4;&#x56DE;<code>IMixinErrorHandler.ErrorAction.ERROR</code>&#xFF0C;&#x5219;&#x8868;&#x793A;&#x8981;&#x6C42;&#x629B;&#x51FA;&#x5F02;&#x5E38;&#x5E76;&#x9000;&#x51FA;&#x6E38;&#x620F;&#xFF0C;&#x5982;&#x679C;&#x8FD4;&#x56DE;<code>null</code>&#xFF0C;&#x5219;&#x8868;&#x793A;&#x4F7F;&#x7528;&#x9ED8;&#x8BA4;&#x7684;&#x5F02;&#x5E38;&#x7B49;&#x7EA7;&#x3002;</li>
</ul>
</li>
<li><code>onApplyError</code>: &#x5728;&#x5E94;&#x7528;Mixin&#x6CE8;&#x5165;&#x51FA;&#x73B0;&#x5F02;&#x5E38;&#x65F6;&#x8C03;&#x7528;&#xFF1A;<ul>
<li><code>targetClassName</code>: &#x5F15;&#x53D1;&#x5F02;&#x5E38;&#x7684;&#x76EE;&#x6807;&#x7C7B;&#x5168;&#x540D;&#xFF1B;</li>
<li>&#x5176;&#x4F59;&#x540C;&#x4E0A;&#x3002;</li>
</ul>
</li>
</ul>
<p>&#x5B9E;&#x73B0;&#x8FD9;&#x4E2A;&#x63A5;&#x53E3;&#x7684;&#x7C7B;&#x4E5F;&#x9700;&#x8981;&#x5728;&#x5F15;&#x5BFC;Mixin&#x65F6;&#x6DFB;&#x52A0;&#xFF1A;</p>
<pre><code class="lang-java"><span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">injectIntoClassLoader</span><span class="hljs-params">(LaunchClassLoader classLoader)</span> </span>{
    MixinBootstrap.init();
    Mixins.addConfiguration(<span class="hljs-string">&quot;mixins.example.json&quot;</span>);
    Mixins.registerErrorHandlerClass(<span class="hljs-string">&quot;com.example.ExampleErrorHandler&quot;</span>);
}
</code></pre>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="5.6.html" class="navigation navigation-prev " aria-label="Previous page: 融合">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="5.8.html" class="navigation navigation-next " aria-label="Next page: 调试">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"扩展","level":"1.8.7","depth":2,"next":{"title":"调试","level":"1.8.8","depth":2,"path":"5.8.md","ref":"5.8.md","articles":[]},"previous":{"title":"融合","level":"1.8.6","depth":2,"path":"5.6.md","ref":"5.6.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"5.7.md","mtime":"2019-09-08T00:42:29.873Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-09-08T04:47:05.818Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

